package com.asialjim.wechat.apiservice.exception;

import lombok.AccessLevel;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.EqualsAndHashCode;

/**
 * <h1><em>ASIAL JIM JAVA DOC</em></h1><hr/>
 * <h2>CLASS DESCRIPTION <i>[ NAME: UnSupportHttpMethodException ]</i></h2><strong>
 * <p> un support http method exception
 * </strong><p><p><em>Copyright &copy; Asial Jim Co., LTD</em><hr/>
 *
 * @author Asial Jim &nbsp;&nbsp; <span>Email:<a href="mailto:asialjim@hotmail.com">asialjim@hotmail.com</a> &nbsp;&nbsp; <a href="asialjim@qq.com">asialjim@qq.com</a></span>
 * @version 1.0.0
 * @since 2021/3/2   &nbsp;&nbsp; JDK 8
 */
@Data
@EqualsAndHashCode(callSuper = false)
@AllArgsConstructor(access = AccessLevel.PRIVATE)
public class UnSupportHttpMethodException extends RuntimeException {
    private String message;
    private static final String EXCEPTION_MESSAGE_TEMPLATE = "Un Support HTTP Method Exception:[%s]";
    public static void cast(String message){
        throw create(message);
    }

    public static UnSupportHttpMethodException create(String message){
        return new UnSupportHttpMethodException(String.format(EXCEPTION_MESSAGE_TEMPLATE,message));
    }
}